# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.VectorTile.V1.Model.ExtrudedArea do
  @moduledoc """
  Represents a height-extruded area: a 3D prism with a constant X-Y plane cross section. Used to represent extruded buildings. A single building may consist of several extruded areas. The min_z and max_z fields are scaled to the size of the tile. An extruded area with a max_z value of 4096 has the same height as the width of the tile that it is on.

  ## Attributes

  *   `area` (*type:* `GoogleApi.VectorTile.V1.Model.Area.t`, *default:* `nil`) - The area representing the footprint of the extruded area.
  *   `maxZ` (*type:* `integer()`, *default:* `nil`) - The z-value in local tile coordinates where the extruded area ends.
  *   `minZ` (*type:* `integer()`, *default:* `nil`) - The z-value in local tile coordinates where the extruded area begins. This is non-zero for extruded areas that begin off the ground. For example, a building with a skybridge may have an extruded area component with a non-zero min_z.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :area => GoogleApi.VectorTile.V1.Model.Area.t() | nil,
          :maxZ => integer() | nil,
          :minZ => integer() | nil
        }

  field(:area, as: GoogleApi.VectorTile.V1.Model.Area)
  field(:maxZ)
  field(:minZ)
end

defimpl Poison.Decoder, for: GoogleApi.VectorTile.V1.Model.ExtrudedArea do
  def decode(value, options) do
    GoogleApi.VectorTile.V1.Model.ExtrudedArea.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.VectorTile.V1.Model.ExtrudedArea do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
